<template>
	<view class="brandSpecialSession">
		<view class="head-box">
			<image src="../../../static/images/icon/brand-left.jpg"></image>
			<view class="main-title">品牌专场</view>
			<image src="../../../static/images/icon/brand-right.jpg"></image>
		</view>
		<view class="list-item">
			<view class="item" 
				v-for="(item, index) in list" 
				:key="index" 
				@click="goDetail(item)"
			>
				<view class="pic" v-if="item.is_new">
					<view class="tips" :class="{'brand' : ptype == 'brand','new' : ptype == 'new'}">新品上市</view>
					<image :src="item.image"></image>
				</view>
				<view class="main-box">
					
					<view>
						<view class="title m-ellipsis">
							<view class="news" v-if="item.dis_old == 100">全新</view>
							<view class="news" v-else>{{item.dis_old}}新</view>
							{{ item.store_name }}
						</view>
						<view class="sub">官方首发新品，量不多</view>
						<view class="type">
							<view v-for="(item, index) in item.StoreProductLabel">
								<view :class="index == 0 ? 'jp' : 'bt'" class="tab">{{item}}</view>
							</view>
						</view>
					</view>
				
					
					<view class="mb-bottom">
						<view class="price">¥<text>{{ item.min_day_price }}</text> <text class="note">/天</text></view>
						<view class="tabs">
							<view class="tab">顺丰包邮</view>
							<!-- <view class="tab">租完归还</view> -->
						</view>
					</view>
					
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			dataType: {
				type: String,
				default: ''
			},
			list: {
				type: Array,
				default: [],
			}
		},
		data() {
			return {
				ptype: this.dataType
			}
		},
		mounted() {
			
		},
		methods: {
			/* 跳转详情 */
			goDetail(e) {
				uni.navigateTo({
					url: `/pages/goods_details/index?id=${e.id}`
				})
			},
		}
	}
</script>

<style lang="scss">
	.brandSpecialSession {
		margin-top: 24rpx;
		padding: 32rpx 24rpx 0 32rpx;
		background-color: #fff;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
		
		.head-box {
			display: flex;
			justify-content: center;
			align-items: center;
			
			image {
				width: 32rpx;
				height: 32rpx;
			}
			
			.main-title {
				margin: 0 8rpx;
				font-size: 32rpx;
				font-weight: bold;
				color: #1F1F1F;
				line-height: 32rpx;
			}
		}
	
		.list-item {
			.item {
				display: flex;
				margin-top: 32rpx;
				
				
				.pic {
					width: 248rpx;
					height: 248rpx;
					background: #FFFFFF;
					border-radius: 16rpx;
					overflow: hidden;
					position: relative;
					
					.tips {
						position: absolute;
						top: 8rpx;
						left: 8rpx;
						z-index: 2;
						width: 112rpx;
						height: 40rpx;
						line-height: 40rpx;
						border-radius: 8rpx;
						text-align: center;
						font-size: 24rpx;
						font-weight: bold;
						color: #FFFFFF;
						
						&.new {
							background: linear-gradient(90deg, #18CC84 0%, #16B877 100%);
						}
						
						&.brand {
							background: linear-gradient(90deg, #FF675C 0%, #FF3341 100%);
						}
					}
					
					image {
						width: 248rpx;
						height: 248rpx;
					}
				}
			
				.main-box {
					flex: 1;
					margin-left: 24rpx;
					padding-bottom: 32rpx;
					border-bottom: 2rpx solid #FAFAFA;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					
					.title {
						font-size: 28rpx;
						font-weight: bold;
						color: #1F1F1F;
						line-height: 44rpx;
						vertical-align: middle;
						
						.news {
							display: inline-block;
							margin-right: 4rpx;
							width: 64rpx;
							height: 40rpx;
							line-height: 40rpx;
							font-size: 24rpx;
							font-weight: bold;
							color: #FFFFFF;
							background: linear-gradient(180deg, #FF9D5C 0%, #FF7847 100%);
							border-radius: 20rpx;
							text-align: center;
						}
					}
				
					.sub {
						margin-top: 16rpx;
						font-size: 24rpx;
						font-weight: 400;
						color: #999999;
						line-height: 24rpx;
					}
					
					.type {
						margin-top: 16rpx;
						display: flex;
						
						view {
							margin-left: 16rpx;
							width: 112rpx;
							height: 40rpx;
							line-height: 40rpx;
							border-radius: 4rpx;
							font-size: 24rpx;
							font-weight: 400;
							text-align: center;
							
							&:first-child { margin-left: 0; }
							
							&.jp {
								background: rgba(255,145,71,0.08);
								color: #FF9147;
							}
							
							&.bt {
								background: rgba(255,96,71,0.08);
								color: #FF3D1F;
							}
						}
					}
				
					.mb-bottom {
						margin-top: 24rpx;
						display: flex;
						align-items: flex-end;
						justify-content: space-between;
						
						.price {
							font-size: 28rpx;
							font-weight: bold;
							color: #FF1F2E;
							vertical-align: text-bottom;
							
							text {
								margin-left: 4rpx;
								font-size: 40rpx;
							}
							
							.note {
								margin-left: 8rpx;
								font-size: 24rpx;
								font-weight: 400;
								color: #FF1F2E;
							}
						}
						
						.tabs {
							display: flex;
							
							.tab {
								margin-left: 8rpx;
								width: 104rpx;
								height: 32rpx;
								line-height: 32rpx;
								background: rgba(110,184,179,0.12);
								border-radius: 4rpx;
								font-size: 24rpx;
								color: #6EB8B3;
								text-align: center;
								
								&:first-child { margin-left: 0; }
							}
						}
					}
				}
			}
		}
	}
</style>